import os
# import sys
# file = stdout
# file.write("Hello World!\n")
# print("Hello World!\n")

# file = open('test.txt', 'r')
# print(file.read(3))  #读三个字节
# #不需要close
# with open('test.txt', 'r',encoding='utf-8') as file2:
#     print(file2.readline())
#     print(file2.readline())
#     list1 = file.readlines()
#     print(list1)


#
# str = "day day up"
# with open('test.txt', 'w', encoding='utf-8') as file3:#w是写，r是读
#     file3.write(str)
# list3 = ("hello","world")
# with open('test.txt', 'a', encoding='utf-8') as file4:#a是追加，不覆盖之前内容
#     file4.write('list3')
#

# file = open('test.txt', 'r')
# print(file.read(3))
# print(file.read(3))
# print(file.tell())
# print(file.seek(2,1))

print(os.getcwd())
os.chdir("D:/PythonProjects/1018/demo7")
print(os.getcwd())
print(os.listdir())
os.chdir("..")
print(os.listdir())